import request from '@/utils/request'

// 查询app用户列表
export function listUsers(query) {
  return request({
    url: '/users/users/list',
    method: 'get',
    params: query
  })
}

// 查询app用户详细
export function getUsers(id) {
  return request({
    url: '/users/users/' + id,
    method: 'get'
  })
}

// 新增app用户
export function addUsers(data) {
  return request({
    url: '/users/users',
    method: 'post',
    data: data
  })
}

// 修改app用户
export function updateUsers(data) {
  return request({
    url: '/users/users',
    method: 'put',
    data: data
  })
}

// 删除app用户
export function delUsers(id) {
  return request({
    url: '/users/users/' + id,
    method: 'delete'
  })

}
//修改状态
export function updateUserStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/users/users/changeStatus',
    method: 'put',
    data: data
  })
}
// 用户密码重置
export function resetUserPwd(id, passwordHash) {
  const data = {
    id,
    passwordHash
  }
  return request({
    url: '/users/users/resetAppPwd',
    method: 'put',
    data: data
  })
}
// 加入黑名单
export function addBlacklist(syAppBlacklist) {
  return request({
    url: '/users/users/insertBlacklist', // 修正 URL 路径
    method: 'post', // 修改为 post 方法
    data: syAppBlacklist // 添加请求体数据
  });
}



